\begin{figure}[ht!]
\begin{center}
\begin{tikzpicture}
[scale=0.65, nodes={scale=0.65, minimum size=26},
yellownode/.style={draw=yellow!50,fill=yellow!30,rounded corners},
orangenode/.style={draw=orange!50,fill=orange!30,rounded corners},
cyannode/.style={draw=cyan!50,fill=cyan!30,rounded corners},
purplenode/.style={draw=purple!50,fill=purple!30,rounded corners},
olivenode/.style={draw=olive!50,fill=olive!30,rounded corners},
bluenode/.style={draw=blue!50,fill=blue!30,rounded corners},
magentanode/.style={draw=magenta!50,fill=magenta!30,rounded corners},
]
{
\node(0) at (9,0.0) [bluenode] {};
\node(1) at (1,-1.5) [orangenode] {};
\node(5) at (4,-1.5) [magentanode] {};
\node(9) at (8,-1.5) [cyannode] {};
\node(11) at (8,-3.0) [purplenode] {};
\node(16) at (13,-1.5) [yellownode] {};
\node(18) at (13,-3.0) [olivenode] {};
\node(2) at (0,-7.5) [orangenode] {};
\node(3) at (1,-7.5) [orangenode] {};
\node(4) at (2,-7.5) [orangenode] {};
\node(6) at (3,-7.5) [magentanode] {};
\node(7) at (4,-7.5) [magentanode] {};
\node(8) at (5,-7.5) [magentanode] {};
\node(10) at (6,-7.5) [cyannode] {};
\node(12) at (7,-7.5) [purplenode] {};
\node(13) at (8,-7.5) [purplenode] {};
\node(14) at (9,-7.5) [cyannode] {};
\node(15) at (10,-7.5) [bluenode] {};
\node(17) at (11,-7.5) [yellownode] {};
\node(19) at (12,-7.5) [olivenode] {};
\node(21) at (14,-7.5) [olivenode] {};
\node(20) at (13,-7.5) [olivenode] {};
\node(23) at (16,-7.5) [bluenode] {};
\node(22) at (15,-7.5) [yellownode] {};
\node(25) at (18,-7.5) [bluenode] {};
\node(24) at (17,-7.5) [bluenode] {};
\draw[thick,blue,-o] (0) -- +(0,-0.6) -| node[near end,sloped,above] {e} (1);
\draw[thick,blue,-o] (0) -- +(0,-0.6) -| node[near end,sloped,above] {g} (5);
\draw[thick,blue,-o] (0) -- +(0,-0.6) -| node[near end,sloped,above] {in} (9);
\draw[thick,cyan,-o] (9) -- +(0,-0.6) -| node[near end,sloped,above] {g} (11);
\draw[thick,blue,-o] (0) -- +(0,-0.6) -| node[near end,sloped,above] {n} (16);
\draw[thick,yellow,-o] (16) -- +(0,-0.6) -| node[near end,sloped,above] {g} (18);
\draw[thick,orange,-o] (1) -- +(0,-0.6) -| node[near end,sloped,above] {ering\#} (2);
\draw[thick,orange,-o] (1) -- +(0,-0.6) -| node[near end,sloped,above] {ngineering\#} (3);
\draw[thick,orange,-o] (1) -- +(0,-0.6) -| node[near end,sloped,above] {ring\#} (4);
\draw[thick,magenta,-o] (5) -- +(0,-0.6) -| node[near end,sloped,above] {ineering\#} (6);
\draw[thick,magenta,-o] (5) -- +(0,-0.6) -| node[near end,sloped,above] {␣engineering\#} (7);
\draw[thick,magenta,-o] (5) -- +(0,-0.6) -| node[near end,sloped,above] {\#} (8);
\draw[thick,cyan,-o] (9) -- +(0,-0.6) -| node[near end,sloped,above] {eering\#} (10);
\draw[thick,purple,-o] (11) -- +(0,-0.6) -| node[near end,sloped,above] {␣engineering\#} (12);
\draw[thick,purple,-o] (11) -- +(0,-0.6) -| node[near end,sloped,above] {\#} (13);
\draw[thick,cyan,-o] (9) -- +(0,-0.6) -| node[near end,sloped,above] {ing␣engineering\#} (14);
\draw[thick,blue,-o] (0) -- +(0,-0.6) -| node[near end,sloped,above] {mining␣engineering\#} (15);
\draw[thick,yellow,-o] (16) -- +(0,-0.6) -| node[near end,sloped,above] {eering\#} (17);
\draw[thick,olive,-o] (18) -- +(0,-0.6) -| node[near end,sloped,above] {ineering\#} (19);
\draw[thick,olive,-o] (18) -- +(0,-0.6) -| node[near end,sloped,above] {␣engineering\#} (20);
\draw[thick,olive,-o] (18) -- +(0,-0.6) -| node[near end,sloped,above] {\#} (21);
\draw[thick,yellow,-o] (16) -- +(0,-0.6) -| node[near end,sloped,above] {ing␣engineering\#} (22);
\draw[thick,blue,-o] (0) -- +(0,-0.6) -| node[near end,sloped,above] {ring\#} (23);
\draw[thick,blue,-o] (0) -- +(0,-0.6) -| node[near end,sloped,above] {␣engineering\#} (24);
\draw[thick,blue,-o] (0) -- +(0,-0.6) -| node[near end,sloped,above] {\#} (25);
};
\end{tikzpicture}
\end{center}
\caption{The suffix tree for the sequence $S$.}
\label{fig:stree}
\end{figure}
